
document.addEventListener('DOMContentLoaded', function () {

    const button = document.getElementById('btn1');
    const button2 = document.getElementById('btn2');
    const button3 = document.getElementById('btn3');

    button.onclick = () => {
        alert(window.parent.myAPI.version);
    }

    button2.onclick = async () => {
        // let x = await myAPI.deskimg('C63ADD69ABE45C9A77518A185B65898B.png');
        let x = await window.parent.myAPI.deskimg('4.png');
        alert(x);
    }

    button3.onclick = async () => {
        let path = await window.parent.myAPI.toBrowseFiles();
        if (path) {
            alert(`选择的路径是：${path}`);
            window.parent.myAPI.deskimg(path);
        }
    }

});
